package com.tenbent.product.center.insures.service.impl;

import com.tenbent.product.base.dto.change.ChangeBoToDto;
import com.tenbent.product.base.service.impl.BaseServiceImpl;
import com.tenbent.product.center.insures.bo.SafeguardPackageDetail;
import com.tenbent.product.center.insures.dto.SafeguardPackageDetailDto;
import com.tenbent.product.center.insures.mapper.SafeguardPackageDetailMapper;
import com.tenbent.product.center.insures.service.SafeguardPackageDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by ThinkPad on 2017/8/21.
 */
@Service(value = "safeguardPackageDetailServiceImpl")
public class SafeguardPackageDetailServiceImpl extends BaseServiceImpl<SafeguardPackageDetail>
		implements SafeguardPackageDetailService {

	public SafeguardPackageDetailServiceImpl() {
		this.setClazz(SafeguardPackageDetail.class);
	}

	@Autowired
	private SafeguardPackageDetailMapper safeguardPackageDetailMapper;

	@Override
	public List<SafeguardPackageDetailDto> findSafeguardPackageDetailByCode(String packageCode) {

		SafeguardPackageDetail query = new SafeguardPackageDetail();
		query.setPackageCode(packageCode);
		return change.changesToDTOList(this.queryObj(query), SafeguardPackageDetailDto.class);
	}
}
